package jk.fox.transport.netty.codec;

import jk.fox.common.RpcDict;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author cuichao
 * @Description: HeartBeatEncode
 * @Date: create in 2020/4/22 21:53
 */
public class HeartBeatEncode extends MessageToByteEncoder<RpcDict.HeartBeat> {

    @Override
    protected void encode(ChannelHandlerContext ctx, RpcDict.HeartBeat msg, ByteBuf out) throws Exception {
        byte[] bytes = msg.toString().getBytes();
        out.writeBytes(bytes);
    }




}
